USE [codbsf]
GO

/****** Object:  Table [dbo].[orders]    Script Date: 12/09/2011 09:04:53 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[orders](
	[idOrder] [int] IDENTITY(1,1) NOT NULL,
	[idUser] [int] NOT NULL,
	[orderDate] [date] NOT NULL,
	[payed] [bit] NOT NULL,
	[delivered] [bit] NOT NULL,
	[payedDate] [date] NULL,
	[deliveredDate] [date] NULL,
 CONSTRAINT [PK_orders] PRIMARY KEY CLUSTERED 
(
	[idOrder] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[orders] ADD  CONSTRAINT [DF_orders_payed]  DEFAULT ((0)) FOR [payed]
GO

ALTER TABLE [dbo].[orders] ADD  CONSTRAINT [DF_orders_delivered]  DEFAULT ((0)) FOR [delivered]
GO

